#include <iostream>
#include <set>
#include <utility>
#include <vector>
#include <map>
#include<algorithm>
using namespace std;
const int N = 1e5;
using PII = pair<int,int>;
map<int,int> parents;//记录关系的并查集
struct
{
    int op,u,v;
}ops[N+5];//操作数组
int find(int x)
{
    while(parents[x] != x) x = parents[x] = parents[parents[x]];
    return x;
}
void merge(int x,int y)
{
    int  parentsx = find(x);
    int  parentsy = find(y);
    parents[parentsy] = parentsx;
}
bool isconnect(int x,int y)
{
    return  find(x) == find(y);
}
int main() {
    int n,m,q;
    cin>>n>>m>>q;
    set<PII> friends;
    for(int i = 0;i<m;i++)
    {
        int u,v;
        cin>>u>>v;
        friends.insert(make_pair(u,v));
        parents[u] = u;
        parents[v] = v;
    }
    int num = 0;
    for(int i = 0;i<q;i++)
    {
        int op,u,v;cin>>op>>u>>v;
        if(op == 1)
        {
            if(friends.find({u,v})!=friends.end())
            {
                friends.erase({u,v});
            }
            else if(friends.find({v,u})!=friends.end())
            {
                friends.erase({v,u});
            }
            else {
                continue;
            }
        }
        ops[num++] = {op,u,v};
    }
    //到这里friends中的就是一个最终版本的并查集了
    for(auto e:friends)
    {
        merge(e.first,e.second);
    }
    //然后构建答案数组
    vector<string> ans;
    for(int i = num-1;i>=0;i--)
    {
        if(ops[i].op == 1)
        {
            merge(ops[i].u,ops[i].v);
        }
        else 
        {
            if(!parents[ops[i].u])
                parents[ops[i].u] = ops[i].u;
            if(!parents[ops[i].v])
                parents[ops[i].v] = ops[i].v;
            ans.push_back(isconnect(ops[i].u,ops[i].v)?"Yes":"No");
        }
    }
    reverse(ans.begin(),ans.end());
    for(auto e:ans)
    {
        cout<<e<<endl;
    }
    return 0;
}
// 64 位输出请用 printf("%lld")